/* processing short cmdline options */

#include <string.h>
#include <stdio.h>
#include <ctype.h>

int main (int argc, char **argv)
{
	short recursive=0, quiet=0, verbose=0, debug=0;
	short i=1, j=1, c;
	while (i<argc) {
		if (argv[i][0] == '-') {
			for (j=1; j < strlen(argv[i]); j++) {
				switch (argv[i][j]) {
					case 'r':
						recursive = 1;
						printf("recursive\n");
						break;
					case 'q':
						quiet = 1;
						printf("quiet\n");
						break;
					case 'v':
						verbose = 1;
						printf("verbose\n");
						break;
					case 'd':
						debug = 1;
						printf("debug\n");
						break;
					default:
						fprintf(stderr, "%s: unrecognized parameter \"%c\"\n", argv[0], argv[i][j]);
						break;
				};
				};
		};
		i++;
		};
	printf("that's it\n");
	return 0;
}
